package com.demo.多线程;

/**
 * @Program: java
 * @ClassName FunctionService
 * @Author: liutao
 * @Description: 函数式接口
 * @Create: 2023-10-27 15:10
 * @Version 1.0
 **/
@FunctionalInterface
interface MyFunctionInterface{
    void run();
}

public class FunctionService {
    public static void main(String[] args) {
        MyFunctionInterface f1= new MyFunctionInterface() {
            @Override
            public void run() {
                System.out.println("function");
            }
        } ;

        MyFunctionInterface f2= () -> System.out.println("function");
        f2.run();
    }
}
